package org.epes.laboratory.vcn.application;

import java.io.Serializable;

public class OptimizationApplication implements Serializable {

	private static final long serialVersionUID = 1L;
	
	public OptimizationApplication() {
		this.setExcelSolution(new String().getBytes());
		this.setExcelAnalysis(new String().getBytes());
	}

	private float x0, y0;
	private float x1, y1;
	private float x2, y2;
	private float x3, y3;
	private float x4, y4;	
	
	private long co2ManagedKnowledge;

	private byte[] excelSolution;
	
	private String excelSolutionName;
	
	private byte[] excelAnalysis;
	
	private String realSequence;
	
	private String realDistance;
	
	private double realCalculatedEmissions;
	
	private String theoreticalOptimalSequence;
	
	private String theoreticalOptimalDistance;
	
	private String theoreticalCalculatedEmissions;
	
	
	public float getX0() {
		return x0;
	}

	public void setX0(float x0) {
		this.x0 = x0;
	}

	public float getY0() {
		return y0;
	}

	public void setY0(float y0) {
		this.y0 = y0;
	}

	public float getX1() {
		return x1;
	}

	public void setX1(float x1) {
		this.x1 = x1;
	}

	public float getY1() {
		return y1;
	}

	public void setY1(float y1) {
		this.y1 = y1;
	}

	public float getX2() {
		return x2;
	}

	public void setX2(float x2) {
		this.x2 = x2;
	}

	public float getY2() {
		return y2;
	}

	public void setY2(float y2) {
		this.y2 = y2;
	}

	public float getX3() {
		return x3;
	}

	public void setX3(float x3) {
		this.x3 = x3;
	}

	public float getY3() {
		return y3;
	}

	public void setY3(float y3) {
		this.y3 = y3;
	}

	public float getX4() {
		return x4;
	}

	public void setX4(float x4) {
		this.x4 = x4;
	}

	public float getY4() {
		return y4;
	}

	public void setY4(float y4) {
		this.y4 = y4;
	}

	public long getCo2ManagedKnowledge() {
		return co2ManagedKnowledge;
	}

	public void setCo2ManagedKnowledge(long co2ManagedKnowledge) {
		this.co2ManagedKnowledge = co2ManagedKnowledge;
	}

	@Override
	public String toString() {
		
		StringBuffer sb = new StringBuffer();
		sb.append("\n  Optimization Application variables:\n");
		sb.append("  -> x0, y0 = " + getX0() + ", " + getY0() + "\n");
		sb.append("  -> x1, y1 = " + getX1() + ", " + getY1() + "\n");
		sb.append("  -> x2, y2 = " + getX2() + ", " + getY2() + "\n");
		sb.append("  -> x3, y3 = " + getX3() + ", " + getY3() + "\n");
		sb.append("  -> x4, y4 = " + getX4() + ", " + getY4() + "\n");
		sb.append("  -> co2ManagedKnowledge = " + this.getCo2ManagedKnowledge() + "\n");		
		sb.append("  -> excelSolution length = " + excelSolution.length + " bytes" + "\n");
		sb.append("  -> excelSolution file name = " + this.getExcelSolutionName() + "\n");
		sb.append("  -> excelAnalysis length = " + excelAnalysis.length + " bytes" + "\n");	
		sb.append("  -> theoretical CO2 emissions = " + this.getTheoreticalCalculatedEmissions() + " g" + "\n");
		sb.append("  -> theoretical distance = " + this.getTheoreticalOptimalDistance() + " Km" + "\n");
		sb.append("  -> theoretical sequence = number " + this.getTheoreticalOptimalSequence() + "\n");
		sb.append("  -> real distance = " + this.getRealDistance() + " Km" + "\n");
		sb.append("  -> real sequence = number " + this.getRealSequence() + "\n");
		sb.append("  -> real CO2 emissions = " + this.getRealCalculatedEmissions() + " g");
		return sb.toString();
	}

	public byte[] getExcelSolution() {
		return excelSolution;
	}

	public void setExcelSolution(byte[] excelSolution) {
		this.excelSolution = excelSolution;
	}

	public byte[] getExcelAnalysis() {
		return excelAnalysis;
	}

	public void setExcelAnalysis(byte[] excelAnalysis) {
		this.excelAnalysis = excelAnalysis;
	}

	public String getRealSequence() {
		return realSequence;
	}

	public void setRealSequence(String realSequence) {
		this.realSequence = realSequence;
	}

	public String getRealDistance() {
		return realDistance;
	}

	public void setRealDistance(String realDistance) {
		this.realDistance = realDistance;
	}

	public double getRealCalculatedEmissions() {
		return realCalculatedEmissions;
	}

	public void setRealCalculatedEmissions(double realCalculatedEmissions) {
		this.realCalculatedEmissions = realCalculatedEmissions;
	}

	public String getTheoreticalOptimalSequence() {
		return theoreticalOptimalSequence;
	}

	public void setTheoreticalOptimalSequence(String theoreticalOptimalSequence) {
		this.theoreticalOptimalSequence = theoreticalOptimalSequence;
	}

	public String getTheoreticalOptimalDistance() {
		return theoreticalOptimalDistance;
	}

	public void setTheoreticalOptimalDistance(String theoreticalOptimalDistance) {
		this.theoreticalOptimalDistance = theoreticalOptimalDistance;
	}

	public String getTheoreticalCalculatedEmissions() {
		return theoreticalCalculatedEmissions;
	}

	public void setTheoreticalCalculatedEmissions(
			String theoreticalCalculatedEmissions) {
		this.theoreticalCalculatedEmissions = theoreticalCalculatedEmissions;
	}

	public String getExcelSolutionName() {
		return excelSolutionName;
	}

	public void setExcelSolutionName(String excelSolutionName) {
		this.excelSolutionName = excelSolutionName;
	}
}
